home *** CD-ROM | disk | FTP | other *** search
/ AmigActive 21 / AACD 21.iso / AACD / Utilities / Ghostscript / src / gxpaint.h < prev    next >
Encoding:
C/C++ Source or Header  |  2001-01-01  |  4.2 KB  |  126 lines

  1. /* Copyright (C) 1994, 1995, 1996, 1997, 1999 Aladdin Enterprises.  All rights reserved.
  2.   
  3.   This file is part of AFPL Ghostscript.
  4.   
  5.   AFPL Ghostscript is distributed with NO WARRANTY OF ANY KIND.  No author or
  6.   distributor accepts any responsibility for the consequences of using it, or
  7.   for whether it serves any particular purpose or works at all, unless he or
  8.   she says so in writing.  Refer to the Aladdin Free Public License (the
  9.   "License") for full details.
  10.   
  11.   Every copy of AFPL Ghostscript must include a copy of the License, normally
  12.   in a plain ASCII text file named PUBLIC.  The License grants you the right
  13.   to copy, modify and redistribute AFPL Ghostscript, but only under certain
  14.   conditions described in the License.  Among other things, the License
  15.   requires that the copyright notice and this notice be preserved on all
  16.   copies.
  17. */
  18.  
  19. /*$Id: gxpaint.h,v 1.2 2000/09/19 19:00:39 lpd Exp $ */
  20. /* Internal interface to fill/stroke */
  21. /* Requires gsropt.h, gxfixed.h, gxpath.h */
  22.  
  23. #ifndef gxpaint_INCLUDED
  24. #  define gxpaint_INCLUDED
  25.  
  26. #ifndef gs_imager_state_DEFINED
  27. #  define gs_imager_state_DEFINED
  28. typedef struct gs_imager_state_s gs_imager_state;
  29. #endif
  30.  
  31. #ifndef gs_state_DEFINED
  32. #  define gs_state_DEFINED
  33. typedef struct gs_state_s gs_state;
  34. #endif
  35.  
  36. #ifndef gx_device_DEFINED
  37. #  define gx_device_DEFINED
  38. typedef struct gx_device_s gx_device;
  39. #endif
  40.  
  41. #ifndef gx_device_color_DEFINED
  42. #  define gx_device_color_DEFINED
  43. typedef struct gx_device_color_s gx_device_color;
  44. #endif
  45.  
  46. /* ------ Graphics-state-aware procedures ------ */
  47.  
  48. /*
  49.  * The following procedures use information from the graphics state.
  50.  * They are implemented in gxpaint.c.
  51.  */
  52.  
  53. int gx_fill_path(P6(gx_path * ppath, gx_device_color * pdevc, gs_state * pgs,
  54.             int rule, fixed adjust_x, fixed adjust_y));
  55. int gx_stroke_fill(P2(gx_path * ppath, gs_state * pgs));
  56. int gx_stroke_add(P3(gx_path *ppath, gx_path *to_path, const gs_state * pgs));
  57. /*
  58.  * gx_imager_stroke_add needs a device for the sake of absolute-length
  59.  * dots (and for no other reason).
  60.  */
  61. int gx_imager_stroke_add(P4(gx_path *ppath, gx_path *to_path,
  62.                 gx_device *dev, const gs_imager_state *pis));
  63.  
  64. /* ------ Imager procedures ------ */
  65.  
  66. /*
  67.  * Tweak the fill adjustment if necessary so that (nearly) empty
  68.  * rectangles are guaranteed to produce some output.
  69.  */
  70. void gx_adjust_if_empty(P2(const gs_fixed_rect *, gs_fixed_point *));
  71.  
  72. /*
  73.  * Compute the amount by which to expand a stroked bounding box to account
  74.  * for line width, caps and joins.  If the amount is too large to fit in a
  75.  * gs_fixed_point, return gs_error_limitcheck.  Return 0 if the result is
  76.  * exact, 1 if it is conservative.
  77.  *
  78.  * This procedure is fast, but the result may be conservative by a large
  79.  * amount if the miter limit is large.  If this matters, use strokepath +
  80.  * pathbbox.
  81.  */
  82. int gx_stroke_path_expansion(P3(const gs_imager_state *pis,
  83.                 const gx_path *ppath, gs_fixed_point *ppt));
  84.  
  85. /* Backward compatibility */
  86. #define gx_stroke_expansion(pis, ppt)\
  87.   gx_stroke_path_expansion(pis, (const gx_path *)0, ppt)
  88.  
  89. /*
  90.  * The following procedures do not need a graphics state.
  91.  * These procedures are implemented in gxfill.c and gxstroke.c.
  92.  */
  93.  
  94. /* Define the parameters passed to the imager's filling routine. */
  95. #ifndef gx_fill_params_DEFINED
  96. #  define gx_fill_params_DEFINED
  97. typedef struct gx_fill_params_s gx_fill_params;
  98. #endif
  99. struct gx_fill_params_s {
  100.     int rule;            /* -1 = winding #, 1 = even/odd */
  101.     gs_fixed_point adjust;
  102.     float flatness;
  103.     bool fill_zero_width;    /* if true, make zero-width/height */
  104.     /* rectangles one pixel wide/high */
  105. };
  106.  
  107. #define gx_fill_path_only(ppath, dev, pis, params, pdevc, pcpath)\
  108.   (*dev_proc(dev, fill_path))(dev, pis, ppath, params, pdevc, pcpath)
  109.  
  110. /* Define the parameters passed to the imager's stroke routine. */
  111. #ifndef gx_stroke_params_DEFINED
  112. #  define gx_stroke_params_DEFINED
  113. typedef struct gx_stroke_params_s gx_stroke_params;
  114. #endif
  115. struct gx_stroke_params_s {
  116.     float flatness;
  117. };
  118.  
  119. int gx_stroke_path_only(P7(gx_path * ppath, gx_path * to_path, gx_device * dev,
  120.                const gs_imager_state * pis,
  121.                const gx_stroke_params * params,
  122.                const gx_device_color * pdevc,
  123.                const gx_clip_path * pcpath));
  124.  
  125. #endif /* gxpaint_INCLUDED */
  126.